using System;
using System.Collections.Generic;
using System.Text;

using RexToy.Compiler.Lexical;
using RexToy.Compiler.Semantic;
using RexToy.ExpressionLanguage.Tokens;

namespace RexToy.ExpressionLanguage.AST
{
    public class OperatorNode : Node_2
    {
        private Token<TokenType> _opToken;
        public Token<TokenType> Token
        {
            get { return _opToken; }
        }

        internal OperatorNode(Token<TokenType> opToken, Node lhs, Node rhs)
        {
            opToken.ThrowIfNullArgument("opToken");
            lhs.ThrowIfNullArgument("lhs");
            rhs.ThrowIfNullArgument("rhs");

            _opToken = opToken;
            _node1 = lhs;
            _node2 = rhs;
        }

        public Node Lhs
        {
            get { return _node1; }
        }

        public Node Rhs
        {
            get { return _node2; }
        }
    }
}
